package com.example.dell.intelligentagriculture.utils;

import android.app.Activity;
import android.content.Context;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;

public class ReturnImage extends AppCompatImageView implements View.OnClickListener {
    private ImageView back;
    public ReturnImage(Context context) {
        super(context);
        setOnClickListener(this);
    }

    public ReturnImage(Context context, AttributeSet attrs) {
        super(context, attrs);
        setOnClickListener(this);
    }

    public ReturnImage(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        Context context =v.getContext();
        // System.exit(0);
        Activity activity=(Activity) context;
        // getContext().finish();
        activity.finish();
    }
}
